home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / zendisk1.zip / LST8-16.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  584b  |  25 lines

  1. ;
  2. ; *** Listing 8-16 ***
  3. ;
  4. ; Adds AL to each element in an array until the result
  5. ; of an addition exceeds 7Fh.
  6. ; Uses two jumps in the loop, with a final INC to adjust
  7. ; BX for the last addition.
  8. ;
  9.     jmp    Skip
  10. ;
  11. Data    db    999 dup (0),7fh
  12. ;
  13. Skip:
  14.     mov    bx,offset Data
  15.     mov    al,2    ;we'll add 2 to each array element
  16.     call    ZTimerOn
  17. AddLoop:
  18.     add    [bx],al    ;add the value to this element
  19.     js    EndAddLoop ;done if Sign flag set
  20.     inc    bx    ;point to the next array element
  21.     jmp    AddLoop    ;do the next element
  22. EndAddLoop:
  23.     inc    bx    ;adjust BX for the final addition
  24.     call    ZTimerOff
  25.